/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* 容器样式 */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: #666;
    font-size: 14px;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* 头部样式 */
.header {
    background-color: #fff;
    padding: 16px 20px;
    margin: 16px -16px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1890ff;
}

.user-info {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
}

/* 搜索区域 */
.search-section {
    margin: 20px 0;
}

.search-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.scan-btn, .search-btn, .retry-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.scan-btn {
    background-color: #52c41a;
    color: white;
    min-width: 44px;
}

.scan-btn:hover {
    background-color: #389e0d;
}

.search-btn {
    background-color: #1890ff;
    color: white;
    min-width: 80px;
}

.search-btn:hover {
    background-color: #096dd9;
}

.search-btn:disabled, .scan-btn:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

/* 客户详情区域 */
.customer-detail-section {
    flex: 1;
    margin-bottom: 20px;
}

.customer-detail {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 客户基本信息 */
.customer-basic-info {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.customer-avatar {
    flex-shrink: 0;
}

.customer-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.customer-info {
    flex: 1;
}

.customer-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #262626;
}

.customer-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.customer-type, .customer-gender {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.customer-type {
    background-color: #e6f7ff;
    color: #1890ff;
}

.customer-gender {
    background-color: #f6ffed;
    color: #52c41a;
}

.customer-corp {
    margin-top: 12px;
}

.customer-corp p {
    margin-bottom: 4px;
    font-size: 14px;
    color: #666;
}

.customer-corp strong {
    color: #262626;
    margin-right: 8px;
}

/* 跟进人信息 */
.follow-users-section {
    padding: 24px;
}

.follow-users-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #262626;
}

.follow-users-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.follow-user-item {
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background-color: #fafafa;
}

.follow-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.follow-user-id {
    font-weight: 600;
    color: #262626;
}

.follow-user-time {
    font-size: 12px;
    color: #999;
}

.follow-user-details {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.follow-user-remark {
    margin-bottom: 4px;
}

.follow-user-description {
    margin-bottom: 8px;
}

.follow-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
}

/* 空状态和错误状态 */
.empty-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon, .error-icon {
    margin-bottom: 16px;
}

.empty-state p, .error-state p {
    color: #666;
    font-size: 16px;
    margin-bottom: 16px;
}

.retry-btn {
    background-color: #1890ff;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.retry-btn:hover {
    background-color: #096dd9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 0 12px;
    }
    
    .header {
        margin: 12px -12px 0;
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .search-container {
        padding: 16px;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .scan-btn, .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .customer-basic-info {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .customer-avatar {
        align-self: center;
    }
    
    .customer-meta {
        justify-content: center;
    }
    
    .follow-users-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .customer-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .customer-info h2 {
        font-size: 20px;
    }
    
    .search-input-group {
        gap: 8px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}